!{include file='common/iheader.htm'}
<style>
	.image_list{width:98%;float:none;display: inline-block;border-top:3px solid #AED0EA;padding:5px;}
	.image_list .img_wrap{float:left;margin-right:8px;}
	.image_list li{width:270px;}
	.i_wrap{}
	.option_div{width:98%;position:absolute;bottom:0;}
</style>
<div id="i_nav">
	<h3 class="page_title">360度产品展示管理</h3>
	<a class="button" href="/manager.php?app=show_360&act=edit">添加产品</a>
</div>
<ul class="image_list">
	!{foreach from=$products item=p}
	<li id="l_!{$p._id}">
		<img src="!{res file=$p.picture thumb=80x80}" img_id="!{$p._id}"/>
		<h6>!{$p.name}</h6>
		( <span>!{$p.frame}</span>帧 )<br>
		<a href="/manager.php?app=show_360&act=edit&id=!{$p._id}">修改</a>
		<a href="javascript:void(0);" onclick="del('!{$p._id}')">删除</a>
		!{if $p.frame gt 0}
		<a href="/manager.php?app=show_360&act=view&id=!{$p._id}">预览</a>
		!{/if}
	</li>
	!{foreachelse}
	<li><img src="!{res file='images/no_pic.jpg' thumb=80x80}"/></li>
	!{/foreach}
</ul>
<div class="option_div">
	<div class="pager">
	!{include file='common/pager.htm'}
	</div>
</div>
<script>
	$(function(){
		$('.image_list img').auto_img();
	});
	
	function del(id){
		if(confirm('删除将无法恢复，是否继续？')){
			show_loading();
			$.get('/manager.php?app=show_360&act=delete&id=' + id, function(data){
				close_loading();
				var json = eval('('+data+')');
				if(json.result){
					//删除成功
					$('#l_' + id).remove();
				}else{
					alert(json.info);
				}
			})
		}
	}
</script>
!{include file='common/ifooter.htm'}